<%--
  Created by IntelliJ IDEA.
  User: Nieyu
  Date: 2016/11/24
  Time: 21:37
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="sf" uri="http://www.springframework.org/tags/form" %>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" %>
<%@taglib prefix="pg" uri="http://jsptags.com/tags/navigation/pager" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt" %>
<html>
<head>
    <meta charset="utf-8"/>
    <script src="<%=request.getContextPath()%>/resources/js/jQuery/jquery-2.1.4.min.js" type="text/javascript"></script>
    <script src="<%=request.getContextPath()%>/resources/js/pdata.js" type="text/javascript"></script>
    <title>表二</title>
    <style>
        h1 {
            text-align: center;
            margin-bottom: 10px;
        }

        table {
            border-collapse: collapse;
            margin: 0 auto;
        }

        th, td {
            width: 28px;
            font-family: "微软雅黑";
            font-size: 16px;
            vertical-align: top;
            text-align: center;
        }

        th {
            line-height: 25px;
        }

        .th {
            text-align: center;
            vertical-align: middle;
            width: 80px;
        }

        .sth {
            text-align: center;
            vertical-align: middle;
            width: 155px;
        }
    </style>
</head>
<body>
<c:if test="${empty param.grade}">
    <h1>四川旅游学院本科教学质量评价表</h1>
</c:if>
<c:if test="${not empty param.grade}">
    <c:forEach var="collect" items="${pagers.datas}" begin="0" end="0">
        <h1>四川旅游学院${collect.grade}级${collect.major}专业本科教学质量评价表</h1>
    </c:forEach>
</c:if>
<table border="1">
    <tr style="width: 607px">
        <td colspan="10">
            <form method="get" action="<%=request.getContextPath()%>/collect/collect_info">

                <select name="grade" id="input_province">
                    <option name="grade" selected><c:if test="${param.grade eq null}">请选择年级</c:if>
                        ${param.grade}</option>
                </select>

                <select name="department" id="input_city">
                    <OPTION name="department" selected><c:if test="${param.department eq null}">请选择院系</c:if>
                        ${param.department}</OPTION>
                </select>

                <select name="major" id="input_area">
                    <OPTION name="major" selected><c:if test="${param.major eq null}">请选择专业</c:if>
                        ${param.major}</OPTION>
                </select>
                <input type="submit" value="查询"/>
            </form>
        </td>
        <c:if test="${not empty param.grade}">
        <td colspan="1">
            <form action="<%=request.getContextPath()%>/collect/secondSemester" id="course_form1" method="get">
                <input type="hidden" name="grade" value="${param.grade}">
                <input type="hidden" name="department" value="${param.department}">
                <input type="hidden" name="major" value="${param.major}">
                <input type="submit" value="第二学年信息"/>
            </form>
        </td>
        <td colspan="1">
            <form action="<%=request.getContextPath()%>/collect/thirdSemester" id="course_form2" method="get">
                <input type="hidden" name="grade" value="${param.grade}">
                <input type="hidden" name="department" value="${param.department}">
                <input type="hidden" name="major" value="${param.major}">
                <input type="submit" value="第三学年信息"/>
            </form>
        </td>
        <td colspan="1">
            <form action="<%=request.getContextPath()%>/collect/fourthSemester" id="course_form3" method="get">
                <input type="hidden" name="grade" value="${param.grade}">
                <input type="hidden" name="department" value="${param.department}">
                <input type="hidden" name="major" value="${param.major}">
                <input type="submit" value="第四学年信息"/>
            </form>
        </td>
        </c:if>
<c:if test="${empty param.grade}">
    <td colspan="1"></td>
    <td colspan="1"></td>
    <td colspan="1"></td>
    </c:if>
    </tr>
    <tr>
        <th rowspan="2" class="thSemes">课程编号</th>
        <th rowspan="2" class="thNum">课程名称</th>
        <c:if test="${param.grade ne null}">
            <c:forEach var="collect" items="${pagers.datas}" begin="0" end="0">
                <th colspan="3">${fn:substring(collect.semester, 0, 4)}学年上期</th>
                <th colspan="3">${fn:substring(collect.semester, 0, 4)}学年下期</th>
            </c:forEach>
        </c:if>
        <c:if test="${param.grade eq null}">
            <th colspan="3">第一学年上期</th>
            <th colspan="3">第二学年下期</th>
        </c:if>
        <th rowspan="2" class="th">全学年参评</th>
        <th rowspan="2" class="thSmall">平均分值</th>
        <th rowspan="2" class="thSmall">二级评价</th>
        <th rowspan="2" class="thSmall">校级评价</th>
        <th rowspan="2" class="thSmall">综合评价</th>
    </tr>
    <tr>
        <th class="sth">学生参评数/应评人数</th>
        <th class="th">学生参评率</th>
        <th class="thSmall">平均分值</th>
        <th class="sth">学生参评数/应评人数</th>
        <th class="th">学生参评率</th>
        <th class="thSmall">平均分值</th>
    </tr>
    <c:if test="${pagers.totalPage le 0 }">
        <tr>
            <td colspan="13">无相关评教信息</td>
        </tr>
    </c:if>
    <c:if test="${pagers.totalPage gt 0}">

        <c:set value="0" var="count"/>
        <c:set value="0" var="fSemester"/>
        <c:set value="0" var="sSemester"/>
        <c:set value="0" var="sumOne"/>
        <c:set value="0" var="sumTwo"/>
        <c:set value="0" var="sumScoreOne"/>
        <c:set value="0" var="sumScoreTwo"/>
        <c:set value="0" var="sumCouncilor"/>
        <c:set value="0" var="sumExpert"/>
        <c:set value="0" var="sumToalScore"/>
        <c:set value="0" var="countExpert"/>
        <c:set value="0" var="countCouncilor"/>
        <c:forEach items="${pagers.datas}" var="collect" varStatus="">

            <c:set value="${count + 1}" var="count"/>
            <c:if test="${collect.councilorScore ne null}">
                <c:set value="${countCouncilor + 1}" var="countCouncilor"/>
            </c:if>
            <c:if test="${collect.expertScore ne null}">
                <c:set value="${countExpert + 1}" var="countExpert"/>
            </c:if>
            <tr>
                <td class="td">${collect.courseNumber}</td>
                <td class="td">${collect.course}</td>
                <c:set value="${sumCouncilor + collect.councilorScore}" var="sumCouncilor"/>
                <c:set value="${sumExpert + collect.expertScore}" var="sumExpert"/>
                <c:if test="${collect.studentScore != null && collect.councilorScore != null
                && collect.expertScore != null}">
                    <c:set value="${(collect.studentScore + collect.councilorScore + collect.expertScore)/3}"
                           var="tScore"/>
                </c:if>
                <c:if test="${collect.studentScore == null && collect.councilorScore != null
                && collect.expertScore != null}">
                    <c:set value="${(collect.councilorScore + collect.expertScore)/2}"
                           var="tScore"/>
                </c:if>
                <c:if test="${collect.studentScore != null && collect.councilorScore == null
                && collect.expertScore != null}">
                    <c:set value="${(collect.studentScore + collect.expertScore)/2}"
                           var="tScore"/>
                </c:if>
                <c:if test="${collect.studentScore != null && collect.councilorScore != null
                && collect.expertScore == null}">
                    <c:set value="${(collect.studentScore + collect.councilorScore)/2}"
                           var="tScore"/>
                </c:if>
                <c:if test="${collect.studentScore != null && collect.councilorScore == null
                && collect.expertScore == null}">
                    <c:set value="${collect.studentScore}"
                           var="tScore"/>
                </c:if>
                <c:if test="${collect.studentScore == null && collect.councilorScore != null
                && collect.expertScore == null}">
                    <c:set value="${collect.councilorScore}"
                           var="tScore"/>
                </c:if>
                <c:if test="${collect.studentScore == null && collect.councilorScore == null
                && collect.expertScore != null}">
                    <c:set value="${collect.expertScore}"
                           var="tScore"/>
                </c:if>
                <c:set value="${sumToalScore + tScore}" var="sumToalScore"/>
                <c:if test="${fn:contains(collect.semester, '第一学期')}">

                    <c:set value="${fSemester + 1}" var="fSemester"/>
                    <c:set value="${sumOne + collect.numbers/collect.totalNumber}" var="sumOne"/>
                    <c:set value="${sumScoreOne + collect.studentScore}" var="sumScoreOne"/>
                    <td class="td">${collect.numbers}/${collect.totalNumber}</td>
                    <td class="td"><fmt:formatNumber type="number"
                                          value="${(collect.numbers/collect.totalNumber)*100}"
                                          pattern="0.00" maxFractionDigits="2"/>%
                    </td>
                    <td class="td"><fmt:formatNumber type="number"
                                          value="${collect.studentScore}"
                                          pattern="0.00" maxFractionDigits="2"/></td>
                    <td></td>
                    <td></td>
                    <td></td>
                </c:if>
                <c:if test="${fn:contains(collect.semester, '第二学期')}">

                    <c:set value="${sSemester + 1}" var="sSemester"/>
                    <c:set value="${sumTwo + collect.numbers/collect.totalNumber}" var="sumTwo"/>
                    <c:set value="${sumScoreTwo + collect.studentScore}" var="sumScoreTwo"/>
                    <td></td>
                    <td></td>
                    <td></td>
                    <td class="td">${collect.numbers}/${collect.totalNumber}</td>
                    <td class="td"><fmt:formatNumber type="number"
                                          value="${(collect.numbers/collect.totalNumber)*100}"
                                          pattern="0.00" maxFractionDigits="2"/>%
                    </td>
                    <td class="td"><fmt:formatNumber type="number"
                                          value="${collect.studentScore}"
                                          pattern="0.00" maxFractionDigits="2"/></td>
                </c:if>

                <td class="td"><fmt:formatNumber type="number"
                                      value="${(collect.numbers/collect.totalNumber)*100}"
                                      pattern="0.00" maxFractionDigits="2"/>%
                </td>
                <td class="td"><fmt:formatNumber type="number"
                                      value="${collect.studentScore}"
                                      pattern="0.00" maxFractionDigits="2"/></td>
                <td class="td"><fmt:formatNumber type="number"
                                      value="${collect.councilorScore}"
                                      pattern="0.00" maxFractionDigits="2"/></td>
                <td class="td"><fmt:formatNumber type="number"
                                      value="${collect.expertScore}"
                                      pattern="0.00" maxFractionDigits="2"/></td>
                <td class="td"><fmt:formatNumber type="number" value="${tScore}" pattern="0.00" maxFractionDigits="2"/></td>
            </tr>

        </c:forEach>

        <tr>
            <c:forEach var="collect" items="${pagers.datas}" begin="0" end="0">
                <td class="td">${fn:substring(collect.semester, 0, 11)}</td>
            </c:forEach>
            <c:if test="${pagers.totalPage ne 1 && pagers.pageIndex ne pagers.totalPage}">
                <td class="td">${count}门本科课程</td>
            </c:if>
            <c:if test="${pagers.totalPage eq 1}">
                <td class="td">${count}门本科课程</td>
            </c:if>
            <c:if test="${fSemester ne 0}">
                <td class="td">${fSemester}门本科课程</td>
                <td class="td"><fmt:formatNumber type="number"
                                      value="${sumOne * 100}"
                                      pattern="0.00" maxFractionDigits="2"/>%
                </td>
                <td class="td"><fmt:formatNumber type="number"
                                      value="${sumScoreOne}"
                                      pattern="0.00" maxFractionDigits="2"/></td>
            </c:if>
            <c:if test="${fSemester eq 0}">
                <td></td>
                <td></td>
                <td></td>
            </c:if>
            <c:if test="${sSemester ne 0}">
                <td class="td">${sSemester}门本科课程</td>
                <td class="td"><fmt:formatNumber type="number"
                                      value="${sumTwo * 100}"
                                      pattern="0.00" maxFractionDigits="2"/>%
                </td>
                <td class="td"><fmt:formatNumber type="number"
                                      value="${sumScoreTwo}"
                                      pattern="0.00" maxFractionDigits="2"/></td>
            </c:if>
            <c:if test="${sSemester eq 0}">
                <td></td>
                <td></td>
                <td></td>
            </c:if>

            <td class="td"><fmt:formatNumber type="number"
                                  value="${(sumOne + sumTwo)*100}"
                                  pattern="0.00" maxFractionDigits="2"/>%
            </td>
            <td class="td"><fmt:formatNumber type="number"
                                  value="${sumScoreOne + sumScoreTwo}"
                                  pattern="0.00" maxFractionDigits="2"/></td>
            <c:if test="${countCouncilor ne 0}">
                <td class="td"><fmt:formatNumber type="number"
                                      value="${sumCouncilor}"
                                      pattern="0.00" maxFractionDigits="2"/></td>
            </c:if>
            <c:if test="${countCouncilor eq 0}">
                <td></td>
            </c:if>
            <c:if test="${countExpert ne 0}">
                <td class="td"><fmt:formatNumber type="number"
                                      value="${sumExpert}"
                                      pattern="0.00" maxFractionDigits="2"/></td>
            </c:if>
            <c:if test="${countExpert eq 0}">
                <td></td>
            </c:if>
            <td class="td"><fmt:formatNumber type="number"
                                  value="${sumToalScore}"
                                  pattern="0.00" maxFractionDigits="2"/></td>
        </tr>
        <tr>
            <td>平均值</td>
            <c:if test="${pagers.totalPage ne 1 && pagers.pageIndex ne pagers.totalPage}">
                <td class="td">${count}门本科课程</td>
            </c:if>
            <c:if test="${pagers.totalPage eq 1}">
                <td class="td">${count}门本科课程</td>
            </c:if>
            <c:if test="${fSemester ne 0}">
                <td class="td">${fSemester}门本科课程</td>
                <td class="td"><fmt:formatNumber type="number"
                                      value="${(sumOne/fSemester) * 100}"
                                      pattern="0.00" maxFractionDigits="2"/>%
                </td>
                <td class="td"><fmt:formatNumber type="number"
                                      value="${sumScoreOne/fSemester}"
                                      pattern="0.00" maxFractionDigits="2"/></td>
            </c:if>
            <c:if test="${fSemester eq 0}">
                <td></td>
                <td></td>
                <td></td>
            </c:if>
            <c:if test="${sSemester ne 0}">
                <td class="td">${sSemester}门本科课程</td>
                <td class="td"><fmt:formatNumber type="number"
                                      value="${sumTwo/sSemester * 100}"
                                      pattern="0.00" maxFractionDigits="2"/>%
                </td>
                <td class="td"><fmt:formatNumber type="number"
                                      value="${sumScoreTwo/sSemester}"
                                      pattern="0.00" maxFractionDigits="2"/></td>
            </c:if>
            <c:if test="${sSemester eq 0}">
                <td></td>
                <td></td>
                <td></td>
            </c:if>
            <td class="td"><fmt:formatNumber type="number"
                                  value="${(sumOne + sumTwo)/count *100}"
                                  pattern="0.00" maxFractionDigits="2"/>%
            </td>
            <td class="td"><fmt:formatNumber type="number"
                                  value="${(sumScoreOne + sumScoreTwo)/count}"
                                  pattern="0.00" maxFractionDigits="2"/></td>
            <c:if test="${countCouncilor ne 0}">
                <td class="td"><fmt:formatNumber type="number"
                                      value="${sumCouncilor/countCouncilor}"
                                      pattern="0.00" maxFractionDigits="2"/></td>
            </c:if>
            <c:if test="${countCouncilor eq 0}">
                <td></td>
            </c:if>
            <c:if test="${countExpert ne 0}">
                <td class="td"><fmt:formatNumber type="number"
                                      value="${sumExpert/countExpert}"
                                      pattern="0.00" maxFractionDigits="2"/></td>
            </c:if>
            <c:if test="${countExpert eq 0}">
                <td></td>
            </c:if>
            <td class="td"><fmt:formatNumber type="number"
                                  value="${sumToalScore/count}"
                                  pattern="0.00" maxFractionDigits="2"/></td>
        </tr>
        <c:set var="countAll" value="${fn:length(collects)}"/>
        <c:set value="${pagers.pageOffset}" var="pageOffset"/>
        <c:set value="${countAll/15}" var="cutCount"/>
        <c:set value="${1.2}" var="b"/>
        <c:set value="${fn:substring(b,1 ,2 )}" var="c"/>
        <c:set value="${fn:substringBefore(cutCount, c)}" var="countValue"/>

        <c:if test="${countAll <= 15 || countAll % 15 == 0 || pageOffset == countValue*15}">
            <tr>
                <td>总计</td>
                <td></td>
                <td></td>
                <td></td>
                <td></td>
                <td></td>
                <td></td>
                <td></td>
                <td></td>
                <td></td>
                <td></td>
                <td></td>
                <td></td>
            </tr>
            <tr>
                <c:set value="0" var="totalNumber"/>
                <c:set value="0" var="countfSemester"/>
                <c:set value="0" var="countsSemester"/>
                <c:set value="0" var="sRateOne"/>
                <c:set value="0" var="sRateTwo"/>
                <c:set value="0" var="sScoreOne"/>
                <c:set value="0" var="sScoreTwo"/>
                <c:set value="0" var="sCouncilor"/>
                <c:set value="0" var="sExpert"/>
                <c:set value="0" var="cCouncilor"/>
                <c:set value="0" var="cExpert"/>
                <c:set value="0" var="totalScore"/>
                <c:set value="0" var="counttotalScore"/>
                <c:forEach items="${collects}" var="col" varStatus="index">
                    <c:if test="${col.studentScore != null && col.councilorScore != null
                && col.expertScore != null}">
                        <c:set value="${(col.studentScore + col.councilorScore + col.expertScore)/3}"
                               var="totalScore"/>
                    </c:if>
                    <c:if test="${col.studentScore == null && col.councilorScore != null
                && col.expertScore != null}">
                        <c:set value="${(col.councilorScore + col.expertScore)/2}"
                               var="totalScore"/>
                    </c:if>
                    <c:if test="${col.studentScore != null && col.councilorScore == null
                && col.expertScore != null}">
                        <c:set value="${(col.studentScore + col.expertScore)/2}"
                               var="totalScore"/>
                    </c:if>
                    <c:if test="${col.studentScore != null && col.councilorScore != null
                && col.expertScore == null}">
                        <c:set value="${(col.studentScore + col.councilorScore)/2}"
                               var="totalScore"/>
                    </c:if>
                    <c:if test="${col.studentScore != null && col.councilorScore == null
                && col.expertScore == null}">
                        <c:set value="${col.studentScore}"
                               var="totalScore"/>
                    </c:if>
                    <c:if test="${col.studentScore == null && col.councilorScore != null
                && col.expertScore == null}">
                        <c:set value="${col.councilorScore}"
                               var="totalScore"/>
                    </c:if>
                    <c:if test="${col.studentScore == null && col.councilorScore == null
                && collect.expertScore != null}">
                        <c:set value="${col.expertScore}"
                               var="totalScore"/>
                    </c:if>
                    <%--<c:set value="${(col.studentScore + col.councilorScore--%>
                <%--+ col.expertScore)/3}" var="totalScore"/>--%>
                    <c:set value="${counttotalScore + totalScore}" var="counttotalScore"/>
                    <c:set value="${index.count}" var="totalNumber"/>
                    <c:set value="${sCouncilor + col.councilorScore}" var="sCouncilor"/>
                    <c:set value="${sExpert + col.expertScore}" var="sExpert"/>
                    <c:if test="${fn:contains(col.semester, '第一学期')}">
                        <c:set value="${countfSemester + 1}" var="countfSemester"/>
                        <c:set value="${sRateOne + (col.numbers/col.totalNumber)}" var="sRateOne"/>
                        <c:set value="${sScoreOne + col.studentScore}" var="sScoreOne"/>
                    </c:if>
                    <c:if test="${fn:contains(col.semester, '第二学期')}">
                        <c:set value="${countsSemester + 1}" var="countsSemester"/>
                        <c:set value="${sRateTwo + (col.numbers/col.totalNumber)}" var="sRateTwo"/>
                        <c:set value="${sScoreTwo + col.studentScore}" var="sScoreTwo"/>
                    </c:if>
                    <c:if test="${col.councilorScore ne null}">
                        <c:set value="${cCouncilor + 1}" var="cCouncilor"/>
                    </c:if>
                    <c:if test="${col.expertScore ne null}">
                        <c:set value="${cExpert + 1}" var="cExpert"/>
                    </c:if>
                </c:forEach>

                <c:forEach var="coll" items="${collects}" begin="0" end="0">
                    <td>${fn:substring(coll.semester, 0, 11)}</td>
                </c:forEach>
                <td>${totalNumber}门本科课程</td>
                <td>${countfSemester}门本科课程</td>
                <td><fmt:formatNumber type="number"
                                      value="${sRateOne *100}"
                                      pattern="0.00" maxFractionDigits="2"/>%
                </td>
                <td><fmt:formatNumber type="number"
                                      value="${sScoreOne}"
                                      pattern="0.00" maxFractionDigits="2"/></td>
                <td>${countsSemester}门本科课程</td>
                <td><fmt:formatNumber type="number"
                                      value="${sRateTwo *100}"
                                      pattern="0.00" maxFractionDigits="2"/>%
                </td>
                <td><fmt:formatNumber type="number"
                                      value="${sScoreTwo}"
                                      pattern="0.00" maxFractionDigits="2"/></td>
                <td><fmt:formatNumber type="number"
                                      value="${(sRateOne + sRateTwo) *100}"
                                      pattern="0.00" maxFractionDigits="2"/>%
                </td>
                <td><fmt:formatNumber type="number"
                                      value="${sScoreOne + sScoreTwo}"
                                      pattern="0.00" maxFractionDigits="2"/></td>
                <c:if test="${cCouncilor ne 0}">
                    <td><fmt:formatNumber type="number"
                                          value="${sCouncilor}"
                                          pattern="0.00" maxFractionDigits="2"/></td>
                </c:if>
                <c:if test="${cCouncilor eq 0}">
                    <td></td>
                </c:if>
                <c:if test="${cExpert ne 0}">
                    <td><fmt:formatNumber type="number"
                                          value="${sExpert}"
                                          pattern="0.00" maxFractionDigits="2"/></td>
                </c:if>
                <c:if test="${cExpert eq 0}">
                    <td></td>
                </c:if>
                <td><fmt:formatNumber type="number"
                                      value="${counttotalScore}"
                                      pattern="0.00" maxFractionDigits="2"/></td>
            </tr>
            <tr>
                <td>平均值</td>
                <td>${totalNumber}门本科课程</td>
                <td>${countfSemester}门本科课程</td>
                <td><fmt:formatNumber type="number"
                                      value="${(sRateOne/countfSemester) *100}"
                                      pattern="0.00" maxFractionDigits="2"/>%</td>
                <td><fmt:formatNumber type="number"
                                      value="${sScoreOne/countfSemester}"
                                      pattern="0.00" maxFractionDigits="2"/></td>
                <td>${countsSemester}门本科课程</td>
                <td><fmt:formatNumber type="number"
                                      value="${(sRateTwo/countsSemester) *100}"
                                      pattern="0.00" maxFractionDigits="2"/>%</td>
                <td><fmt:formatNumber type="number"
                                      value="${sScoreTwo/countsSemester}"
                                      pattern="0.00" maxFractionDigits="2"/></td>
                <td><fmt:formatNumber type="number"
                                      value="${(sRateOne + sRateTwo)/totalNumber *100}"
                                      pattern="0.00" maxFractionDigits="2"/>%
                </td>
                <td><fmt:formatNumber type="number"
                                      value="${(sScoreOne + sScoreTwo)/totalNumber}"
                                      pattern="0.00" maxFractionDigits="2"/></td>
                <c:if test="${cCouncilor ne 0}">
                    <td><fmt:formatNumber type="number"
                                          value="${sCouncilor/cCouncilor}"
                                          pattern="0.00" maxFractionDigits="2"/></td>
                </c:if>
                <c:if test="${cCouncilor eq 0}">
                    <td></td>
                </c:if>
                <c:if test="${cExpert ne 0}">
                    <td><fmt:formatNumber type="number"
                                          value="${sExpert/cExpert}"
                                          pattern="0.00" maxFractionDigits="2"/></td>
                </c:if>
                <c:if test="${cExpert eq 0}">
                    <td></td>
                </c:if>
                <td><fmt:formatNumber type="number"
                                      value="${counttotalScore/totalNumber}"
                                      pattern="0.00" maxFractionDigits="2"/></td>
            </tr>
        </c:if>
        <tr>
            <td colspan="13">
                <jsp:include page="/jsp/pager.jsp">
                    <jsp:param value="/collect/collect_info" name="url"/>
                    <jsp:param value="${pagers.totalPage }" name="items"/>
                    <jsp:param value="grade,department,major" name="params"/>
                </jsp:include>
            </td>
        </tr>
    </c:if>

</table>
</body>
</html>
<script type="text/javascript">
    $(function () {
        var html = "<option value=''>年级列表</option>";
        $("#input_city").append(html);
        $("#input_area").append(html);
        $.each(pdata, function (idx, item) {
            if (parseInt(item.level) == 0) {
                html += "<option value='" + item.names + "' exid='" + item.code + "'>" + item.names + "</option>";
            }
        });
        $("#input_province").append(html);

        $("#input_province").change(function () {
            if ($(this).val() == "") return;
            $("#input_city option").remove();
            $("#input_area option").remove();
            var code = $(this).find("option:selected").attr("exid");
            code = code.substring(0, 2);
            var html = "<option value=''>院/系列表</option>";
            $("#input_area").append(html);
            $.each(pdata, function (idx, item) {
                if (parseInt(item.level) == 1 && code == item.code.substring(0, 2)) {
                    html += "<option value='" + item.names + "' exid='" + item.code + "'>" + item.names + "</option>";
                }
            });
            $("#input_city").append(html);
        });

        $("#input_city").change(function () {
            if ($(this).val() == "") return;
            $("#input_area option").remove();
            var code = $(this).find("option:selected").attr("exid");
            code = code.substring(0, 4);
            var html = "<option value=''>专业列表</option>";
            $.each(pdata, function (idx, item) {
                if (parseInt(item.level) == 2 && code == item.code.substring(0, 4)) {
                    html += "<option value='" + item.names + "' exid='" + item.code + "'>" + item.names + "</option>";
                }
            });
            $("#input_area").append(html);
        });
        //绑定
//        $("#input_province").val("广东省");$("#input_province").change();
//        $("#input_city").val("深圳市");$("#input_city").change();
//        $("#input_area").val("罗湖区");

    });
</script>